package com.blog.webSocket.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blog.webSocket.domain.ChatMessage;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 任浩
 * @version 1.0
 */

@Mapper
public interface ChatMessageMapper extends BaseMapper<ChatMessage> {

    Page<ChatMessage> selectMessageList(@Param("fromUser") String fromUser, @Param("toUser") String toUser,
                                        @Param("currentIndex") int currentIndex);

    ChatMessage selectRecentMessage(@Param("fromUser") String fromUser,@Param("toUser") String toUser);

    Integer selectNumber(@Param("fromUser") String fromUser,@Param("toUser") String toUser);
}
